package com.msh.starter.captcha.util;

import java.awt.Font;
import java.awt.FontFormatException;
import java.io.IOException;

public class FontUtil {

  public static Font loadResource(String name, float size) throws IOException, FontFormatException {
    return Font.createFont(Font.TRUETYPE_FONT, FontUtil.class.getResourceAsStream("/font/" + name))
        .deriveFont(Font.ITALIC, size);
  }
}
